home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / oop_tp55.zip / LIST3_3.PAS < prev    next >
Pascal/Delphi Source File  |  1990-01-08  |  1KB  |  46 lines

  1. unit NewTags;
  2.  
  3. interface
  4.  
  5. uses Tags, Crt;
  6.  
  7. type
  8.  
  9. PFunc = function : real;
  10. pPFunc = ^PFunc;
  11.  
  12. NewPump = object(DOutput)
  13.           MaxPressure : real;
  14.           ScalingFactor : real;
  15.           GetPressureDemon : PFunc;
  16.           procedure Init( ATag : String12; AStatus : boolean;
  17.                           MaxP, Scale : real;
  18.                           PressFunction : pPFunc );
  19.           function Flow : real;
  20.           end;
  21.  
  22. implementation
  23.  
  24. procedure NewPump.Init( ATag : String12; AStatus : boolean;
  25.                           MaxP, Scale : real;
  26.                           PressFunction: pPFunc );
  27. begin
  28.      Digital.Init( ATag,AStatus);
  29.      MaxPressure := maxP;
  30.      Scalingfactor := Scale;
  31.      @GetPressureDemon := PressFunction;
  32. end;
  33.  
  34. function NewPump.Flow : real;
  35. begin
  36.      if Status = true then
  37.         Flow := Sqrt( (MaxPressure - GetPressureDemon)/ScalingFactor )
  38.      else
  39.         Flow := 0;
  40. end;
  41.  
  42. { Initialization code }
  43. begin
  44.      { None. }
  45. end.
  46.